import variables from '@/styles/variables.scss'

const state = {
    navbarColor: variables.navbarColor,//头部背景 headBackGroundColor
    subMenuBg: variables.subMenuBg,//子集菜单颜色 childMenuColor
    menuBg: variables.menuBg,//菜单背景 menuBackGroundColor
    menuColor: variables.menuColor,//菜单颜色 menuColor
    menuActive: variables.menuActive,//菜单选中颜色 menuOnCheckColor
    ElDialogHeaderBg: variables.ElDialogHeaderBg,//弹窗头部颜色 boxHeadColor
    copyright: variables.copyright,//"版权所有：中科台达（浙江）信息技术有限公司｜ Copyright ? 2019-2025 casdelta.com All Right Reserved"
    recordNumber: variables.recordNumber,// "ICP备案号：浙ICP备19034790号-5"
    logo: variables.logo,// "ICP备案号：浙ICP备19034790号-5"
}

const mutations = {
    CHANGE_SETTING: (state, { key, value }) => {
        if (state.hasOwnProperty(key)) {
            state[key] = value
        }
        // console.log(state[key], value, key);
    }
}

const actions = {
    changeSettings({ commit }, data) {
        for (const [key, value] of Object.entries(data)) {
            commit('CHANGE_SETTING', { key, value });
        }
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}

